﻿#pragma once

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include "Queue.h"

typedef char BTDataType;

typedef struct BinaryTreeNode
{
	BTDataType data;
	struct BinaryTreeNode* left;
	struct BinaryTreeNode* right;
}BTNode;

//前序遍历
void PreOrder(BTNode* root);

//中序遍历
void InOrder(BTNode* root);

//后序遍历
void PostOrder(BTNode* root);

//二叉树节点个数
int BinaryTreeSize(BTNode* root);

//二叉树叶子节点个数
int BinaryTreeLeaveSize(BTNode* root);

//⼆叉树第k层结点个数
int BinaryTreeLevelKSize(BTNode* root, int k);

//二叉树高度
int BinaryTreeDepth(BTNode* root);

//查找值为x的节点
BTNode* BinaryTreeFind(BTNode* root, BTDataType x);

//二叉树的销毁
void BinaryTreeDestroy(BTNode** proot);

//二叉树层序遍历
void LevelOrder(BTNode* root);

//是否为完全二叉树
bool BinaryTreeComplete(BTNode* root);
